@extends('admin.main')
@section('content')
    <div class="admin-content">
        <div class="am-cf am-padding am-padding-bottom-0">
            <div class="am-fl am-cf">
                <strong class="am-text-primary am-text-lg">后台设置</strong> /
                <small>企业资料</small> /
                <small>款式数量</small>
            </div>
        </div>
        <hr>
        <div class="am-g">
            @include('admin.layouts.adminInfo')
            <div class="am-u-sm-12 am-u-md-8 am-u-md-pull-4">
                <form action="{{$prefix_url}}/option/design-set"
                      class="am-form" method="POST" enctype="multipart/form-data">
                    {{csrf_field()}}
                    <input type='hidden' name='_method' value='POST'/>
                    <input type='hidden' name='uid' value='{{$uid}}'/>
                    <input type='hidden' name='cate' value='{{$cate}}'/>
                    <div class='am-form-group'>
                        <h2>款式数量</h2>
                    </div>
                    <style type="text/css">
                        td { border:1px solid #f0f0f0;text-align:center; }
                        td input[type='text'] { padding:5px 0;width:25%;
                            border:0;border-bottom:1px solid #0088cc; }
                    </style>
                    <div class='am-form-group'>
                        <label>产品种类：</label>
                        <br>
                        <table class="am-table am-table-striped
                            am-table-hover table-main">
                            <tr>
                                <td>款式名称</td>
                                <td>数量</td>
                            </tr>
                        @if(count($designs))
                        @foreach($designs as $key => $design)
                            <tr>
                                <td>
                                    <input type="checkbox" name="keys[]"
                                           value="{{$key}}" style="display:none;">
                                    <input type="text" name="name{{$key}}" required
                                           minlength="2" maxlength="20"
                                           value="{{$design['name']}}">
                                </td>
                                <td>
                                    <input type="text" name="num{{$key}}" required
                                           pattern="\d+"
                                           value="{{$design['num']}}">
                                </td>
                            </tr>
                        @endforeach
                        @endif
                            <tr>
                                <td>
                                    <input type="text" name="name"
                                           minlength="2" maxlength="20"
                                           placeholder="款式名称">
                                </td>
                                <td>
                                    <input type="text" name="num"
                                           pattern="\d+"
                                           placeholder="数量">
                                </td>
                            </tr>
                        </table>
                    </div>
                    <button type='button' class='am-btn am-btn-primary'
                            onclick='history.go(-1);'>返回</button>
                    <button type='submit' class='am-btn am-btn-primary'>
                        保存更新</button>
                </form>
                <br><br>
            </div>
        </div>
    </div>

    <script type="text/javascript">
//        //日期组件
//        $(function() {
//            $('.doc-datepicker').datepicker().
//            on('changeDate.datepicker.amui', function(event) {
//                console.log(event.date);
//            });
//        });
    </script>
@stop